<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客文章管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }
        .container {
            width: 600px;
            margin: 20px auto;
            background-color: #fff;
            padding: 20px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }
        textarea {
            width: 100%;
            height: 100px;
            margin-bottom: 10px;
            resize: none;
        }
        button {
            padding: 10px;
            background-color: #333;
            color: #fff;
            border: none;
            cursor: pointer;
        }
        button:hover {
            background-color: #555;
        }
        ul {
            list-style: none;
            padding: 0;
        }
        ul li {
            margin: 10px 0;
            padding: 10px;
            border: 1px solid #ccc;
            position: relative;
        }
        ul li button {
            position: absolute;
            right: 10px;
            top: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h2>发布文章</h2>
        <textarea id="articleContent" placeholder="输入文章内容"></textarea>
        <button id="publishBtn">发布</button>
    </div>
    <div class="container">
        <h2>文章列表</h2>
        <ul id="articleList">
            <!-- 文章列表将动态生成 -->
        </ul>
    </div>

    <script src="jquery.min.js"></script>
    <script>
        $(function() {
            // 发布文章
            $("#publishBtn").click(function() {
                var content = $("#articleContent").val();
                if (content) {
                    var li = $("<li></li>").text(content);
                    var deleteBtn = $("<button>删除</button>").click(function() {
                        $(this).parent().remove();
                    });
                    li.append(deleteBtn);
                    $("#articleList").append(li);
                    $("#articleContent").val("");
                }
            });
        });
    </script>
</body>
</html>
